#include "stdafx.h"
#include <boost/test/auto_unit_test.hpp>
#include "detail/bmock_in_arg_val.hpp"
#include "detail/bmock_expand_arg.hpp"
#include "detail/bmock_test_control_tools.hpp"

namespace bmock {
	static const control_tools_ptr tl(new test_control_tools());
	static const int               val1   = 127;
	static const unsigned char     val2[] = {0x01,0x02,0x03};
	static const void             *val3   = (void *)679;
	static const size_t            L2     = sizeof(val2);

	namespace bmock {
		static std::string test_func(int x
			,size_t l
			,const unsigned char* 
			,const void* val3)
		{
			return std::string(BOOST_PP_STRINGIZE(__BMOCK_EXPAND_ARG(IN(x))))
				+','
				+BOOST_PP_STRINGIZE(__BMOCK_EXPAND_ARG(RAW_MEM(IN,y,l)))
				+BOOST_PP_STRINGIZE(__BMOCK_EXPAND_ARG(IN_PTR(z)));
		}

		BOOST_AUTO_TEST_CASE(test_IN_Macro_ARG) {
			const char expected[] = "bmock::make_in_arg_val(\"x\",x)"
				",bmock::make_in_arg_val(\"y\",bmock::raw_mem(y,l))"
				"bmock::make_in_ptr_arg_val(\"z\",z)";
			BOOST_CHECK_EQUAL(expected,test_func(val1,L2,val2,val3));
		}
	}
}
